<style>
#tableList .drag_orders { width: 25px; height: 25px; background-color: #e7e7e7; text-align: center; line-height: 25px; cursor: move; }
</style>
<div class="m-tab s-tab">
	<h2 class="u-tt">URL规则管理</h2>
	<div class="filter"> 上下拖动数字排序，排序后请保存 </div>
</div>
<div class="m-form">
	<form name="" action="<?php echo url('AdminRewrite/saveData'); ?>" method="post" id="form">
		<table class="m-table m-table-row" id="table">
			<thead class="m-table-thead s-table-thead">
				<tr>
					<th class="cola">排序</th>
					<th>规则(拖动排序数字可排序)</th>
					<th>模块</th>
					<th class="cola">操作</th>
				</tr>
			</thead>
			<tbody id="tableList">
				<!--{loop="$list $key $vo"}-->
				<tr  id="list_{$vo.i}" action-id="{$vo.i}" class="drag_line">
					<td><div class="drag_orders" action-id="{$vo.i}">{$vo.i}</div></td>
					<td><input name="url[]" type="text" class="u-ipt  u-ipt-6"  value="{$vo.url}" /></td>
					<td><input name="model[]" type="text" class="u-ipt" value="{$vo.model}" /></td>
					<td><a href="javascript:;" data="{$vo.replace_id}" class="u-del">移除</a></td>
				</tr>
				<!--{/loop}-->
				<tr>
					<td>新增</td>
					<td><input name="url[]" type="text" class="u-ipt  u-ipt-6" value="" /></td>
					<td><input name="model[]" type="text" class="u-ipt" value=""  /></td>
					<td></td>
				</tr>
			</tbody>
		</table>
		<div class="formitm" style="margin-left:100px;">
			<input name="replace_id" type="hidden" value="{$info.replace_id}" />
			<button class="u-btn" type="submit">保存</button>
			<button class="u-btn s-btn-c3" type="reset">重置</button>
			<span class="status" id="status"></span> 
			</div>
			
	</form>
</div>
<script>
Do.ready('base','dialog','tableList',function() {
	$("#tableList").DragList({
		dgLine:'drag_line',
		dgButton:'drag_orders',
		id:'action-id',
		linePre:'list_'
	});
	$('#table .u-del').click(function() {
		$(this).parent().parent().remove();
	});
});
</script>